package Service.impl;


import Mapper.ExchangeRecordMapper;
import Service.ExchangeRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.ExchangeRecord;

import java.util.List;

@Service
public class ExchangeRecordServiceImpl implements ExchangeRecordService {
    @Autowired
    private ExchangeRecordMapper mapper;

    public List<ExchangeRecord> getRecordsByUser(Long userId) {
        return mapper.findByUserId(userId);
    }

    public void addRecord(ExchangeRecord record) {
        mapper.insert(record);
    }
}
